""" 
功能: TM1637数码管显示 计数
clk 引脚 16
dio 引脚 17

"""

from machine import Pin
import tm1637
import time

TM1637_CLK_PIN = 16
TM1637_DIO_PIN = 17
smg = tm1637.TM1637(clk=Pin(TM1637_CLK_PIN), dio=Pin(TM1637_DIO_PIN))

if __name__ == "__main__":
    smg.number(111)     # 显示数字
    time.sleep(2)
    smg.numbers(3, 14)  # 显示浮点数3.14
    time.sleep(2)
    smg.scroll("123456789", 500)  # 滚动显示, 500ms间隔刷新
    time.sleep(2)
    count = 0
    while True:
        smg.number(count)
        count += 1
        time.sleep(1)
